Skip to content

[Do not merge] Auth server - #1316

Draft
gonpombo8 wants to merge 57 commits into
mainfrom
auth-server
Draft

[Do not merge] Auth server#1316
gonpombo8 wants to merge 57 commits into
mainfrom
auth-server

Conversation

@gonpombo8

@gonpombo8 gonpombo8 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces a new client/server architecture for network messaging, replacing the
previous peer-to-peer CRDT synchronization with a centralized authoritative server model.

Key Changes

New Client/Server Architecture

  • Authoritative Server: Introduced server-side message validation and broadcasting with
    permission checks
  • Client Message Processing: Clients now receive validated messages from the
    authoritative server instead of direct peer-to-peer communication
  • Network Entity Mapping: Added proper entity ID mapping between network messages and
    local entities
  • Message Conversion: Implemented bidirectional conversion between regular CRDT messages
    and network messages

Server-Side Features

  • Message Validation: Server validates all incoming messages before broadcasting to
    prevent invalid state changes
  • Permission System: Basic permission framework for component synchronization
    (foundation for owner/server/all sync modes)
  • Entity Management: Automatic creation and mapping of network entities when new
    entities are introduced
  • Transform Parent Fixing: Server handles Unity-specific transform parent relationships
    for proper hierarchical rendering

Client-Side Changes

  • Simplified CRDT Processing: Clients now only handle regular CRDT messages, with
    network message complexity abstracted away
  • Server Communication: All network messages flow through the authoritative server (peer
    ID: authorative-server)
  • State Synchronization: Initial state requests are handled by the server rather than
    peer-to-peer requests

Message Flow

Before (P2P):
Client A ↔ Client B ↔ Client C

After (Client/Server):
Client A ↘
Server (validates & broadcasts)
Client B ↗ ↘ Client C

Chunking and Broadcasting

  • Efficient Chunking: Adopted proven chunking strategy from engineToCrdt() for
    reliable message splitting
  • Size Limit Compliance: Proper handling of 12KB LiveKit message size limits with
    automatic chunking
  • Batch Processing: Messages are efficiently batched and broadcast as chunks when needed

Technical Architecture

Server Processing Flow

  1. Receive network message from client
  2. Find or create local entity mapping
  3. Validate permissions (owner/component sync rules)
  4. Convert to regular CRDT message for local application
  5. Broadcast validated network message to all other clients

Client Processing Flow

  1. Receive network message from authoritative server
  2. Map network entity to local entity (create if needed)
  3. Convert network message to regular CRDT message
  4. Apply to local engine state

Migration Impact

  • Backwards Compatible: Existing CRDT logic remains unchanged
  • Transport Layer: Network transport now routes through server validation
  • Component Sync: Foundation laid for granular component synchronization modes
  • Performance: Reduced peer-to-peer complexity and improved message validation

Test Plan

  • Server message validation and broadcasting
  • Client network message processing and entity mapping
  • Transform parent fixing for Unity compatibility
  • Message chunking with size limits
  • Initial state synchronization through server

@gonpombo8 gonpombo8 changed the title Auth server [Do not merge] Auth server Feb 13, 2026
@gonpombo8 gonpombo8 mentioned this pull request Feb 13, 2026
5 tasks
@github-actions

github-actions Bot commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/auth-server/dcl-sdk-7.26.1-32160798031.commit-f0d293a.tgz"
  • The @dcl/js-runtime package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/auth-server/@dcl/js-runtime/dcl-js-runtime-7.26.1-32160798031.commit-f0d293a.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/auth-server/dcl-sdk-commands-7.26.1-32160798031.commit-f0d293a.tgz"
    npx $SDK_COMMANDS init
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/auth-server-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=auth-server

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 13, 2026

Copy link
Copy Markdown

Deploying js-sdk-toolchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0b97733
Status: ✅  Deploy successful!
Preview URL: https://e8190d85.js-sdk-toolchain.pages.dev
Branch Preview URL: https://auth-server.js-sdk-toolchain.pages.dev

View logs

@nicoecheza
nicoecheza force-pushed the auth-server branch 2 times, most recently from 111fd7e to ddc8da1 Compare April 23, 2026 12:48
@nicoecheza
nicoecheza force-pushed the auth-server branch 3 times, most recently from 692d570 to 63ddb3f Compare May 4, 2026 13:13
gonpombo8 and others added 14 commits June 25, 2026 17:00
* feat: Add analytics to the storage command

* fix: Use another segment keys
Remove checkRoomReady guard from RES_CRDT_STATE handler and
RealmInfo.onChange server path — the existing checks (realmInfo
truthiness, isConnectedSceneRoom) are sufficient. Also remove
the unused createRoom factory function since Room is instantiated
directly via new Room(...).
When engineToCrdt() returns no chunks, send an empty response so the
requester receives RES_CRDT_STATE and stops retrying. Guard the receiver
against processing empty payloads.
* feat: locomotion settings (#1389)

* feat: locomotion settings (#1238)

* set locomotion settings protocol branch and rebuilt

* serialization tests

* fix: update @dcl/protocol version

* feat: add AudioAnalysis and AvatarLocomotionSettings components to playground-assets API

* fix: export empty object in ReactEcs namespace to resolve documentation warning

* fix: update  snapshot files

---------

Co-authored-by: Rocío Mena <rociocmena@gmail.com>

* feat: add IA_MODIFIER input action support (#1390)

Co-authored-by: Steven Williams <stevenwritescode@gmail.com>

* fix: --no-client no longer breaks file-watch hot reload (#1391)

* feat: add AudioAnalysis component (#1393)

* feat: add AudioAnalysis component definition and tests

Port the AudioAnalysis extended component from the experimental branch.
The protocol already includes audio_analysis.proto on main — this adds
the SDK-side extended component with readIntoView/tryReadIntoView helpers,
createAudioAnalysis/createOrReplaceAudioAnalysis convenience methods,
and serialization tests.

* fix: update playground-assets API review file for AudioAnalysis

Add AudioAnalysisComponentDefinitionExtended interface and
AudioAnalysisView type to the API surface definition.

* rebuild snapshots

* rebuild

* fix: ignoredDeprecations version

* fix: identation

* fix: regenerate playground-assets

* fix: typescript version for tests

---------

Co-authored-by: nearnshaw <earnshaw.nico@gmail.com>
Co-authored-by: Nicolas Earnshaw <nearnshaw@decentraland.org>
Co-authored-by: Gabriel Diaz <gabrieldiaz31@gmail.com>

* build

* Update packages/@dcl/playground-assets/etc/playground-assets.api.md

Signed-off-by: Gabriel Díaz <git@subsme.slmail.me>

* Update snapshots

---------

Signed-off-by: Gabriel Díaz <git@subsme.slmail.me>
Co-authored-by: Rocío Mena <rociocmena@gmail.com>
Co-authored-by: Rocío <69587750+RocioCM@users.noreply.github.com>
Co-authored-by: Steven Williams <stevenwritescode@gmail.com>
Co-authored-by: Nicolas Echezarreta <nicoecheza@gmail.com>
Co-authored-by: nearnshaw <earnshaw.nico@gmail.com>
Co-authored-by: Nicolas Earnshaw <nearnshaw@decentraland.org>
Co-authored-by: Gabriel Diaz <gabrieldiaz31@gmail.com>
Co-authored-by: Gabriel Díaz <git@subsme.slmail.me>
@nicoecheza
nicoecheza force-pushed the auth-server branch 2 times, most recently from dd448d3 to a770a7e Compare June 25, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants